/*
 * Copyright (c) 2025 Oracle and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.helidon.config;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import io.helidon.service.registry.Service;

/**
 * Container class for annotations related to Helidon Configuration when using declarative programming model.
 *
 * @deprecated this API is part of incubating features of Helidon. This API may change including backward incompatible changes
 *               and full removal. We welcome feedback for incubating features.
 */
@Deprecated
public final class Configuration {
    private Configuration() {
    }

    /**
     * A qualifier for injection of a single value from the configuration tree.
     */
    @Target(ElementType.PARAMETER)
    @Retention(RetentionPolicy.CLASS)
    @Documented
    @Service.Qualifier
    public @interface Value {
        /**
         * Configuration key (from the config root) to find the value.
         * <p>
         * Default configuration key is {@code <class_name>.<field_name>} for field injection (if supported),
         * and {@code <className>.<constructor_param_name>} for constructor injection. The {@code <class_name>}
         * is the fully qualified class name of the type that uses this annotation.
         * <p>
         * Note that parameter names are not retained at runtime, so the parameter name when not using
         * build time processing would be generated by the JVM.
         * <p>
         * To define a default value, use one of the {@link io.helidon.common.Default} annotations.
         *
         * @return configuration key
         */
        String value() default "";
    }
}
